from sklearn.preprocessing import OneHotEncoder
import numpy as np

x = np.random.randint(0, 3, [8, 1])

enc = OneHotEncoder(categories='auto')
x_oh = enc.fit_transform(x).toarray()
print(x_oh)
